<style src="./index.scss" lang="scss" scoped rel="stylesheet/scss"></style>
<template src="./index.html"></template>

<script>
export default {
  mixins: [Vue.prototype.$vFN.Mixins.Base],
  data() {
    return {
      item_id: null,
      title: "审核选项",
      // 窗口显示
      boxVisible: false,
      // 页面接口地址
      apiUrl: {
        agree: "mall-site-portal/member-money-withdraw/agree",
        invalid: "mall-site-portal/member-money-withdraw/invalid",
        reject: "mall-site-portal/member-money-withdraw/reject",
      },
      // 用户选择
      radio: "1",
    };
  },
  methods: {
    // 确定
    async submit() {
      let _url = "";
      switch (this.radio) {
        case "1":
          _url = this.apiUrl.agree;
          break;
        case "2":
          _url = this.apiUrl.invalid;
          break;
        case "3":
          _url = this.apiUrl.reject;
          break;
      }

      let _data = await this.$vFN.Http.post(
        {
          url: _url,
          data: {
            id: this.item_id,
          },
        },
        window
      );

      if (_data._ok) {
        this.$vFN.Tools.messageSuccess("提交成功");
        this.editBoxClose();
        this.onSuccess();
      }
    },
    // 关闭窗口
    editBoxClose() {
      this.boxVisible = false;
    },
    // 取消
    editBoxCancel() {
      this.editBoxClose();
    },
  },

  async mounted() {
    this.boxVisible = true;
  },
};
</script>

